package com.itheima.service.impl;

import com.itheima.domain.Huangzhe;
import com.itheima.mapper.ProductMapper;
import com.itheima.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("productServiceImpl")
public class ProductServiceImpl implements ProductService {

    @Autowired
    private ProductMapper productMapper;

    @Override
    public List<Huangzhe> findAll() {
        try {
            List<Huangzhe> huangzheList = productMapper.findAll();
            return huangzheList;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    @Override
    public List<Huangzhe> findByTiaojian(String s) {
        try {
            List<Huangzhe> huangzheList = productMapper.findByTiaojian(s);
            return huangzheList;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
}
